﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LogCard.aspx.cs" Inherits="fsw.Web.Manager.LogCard" %>

<%@ Import Namespace="fsw.Common" %>
<%@ Register Src="~/HeaderJs.ascx" TagPrefix="uc1" TagName="HeaderJs" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit" />
    <title>卡片日志管理</title>
    <uc1:HeaderJs runat="server" ID="HeaderJs" />
    <script src="/public/admin/js/clipboard.min.js"></script>
</head>
<body>
    <div class="position">当前位置：<a href="LogCard.aspx">卡片日志管理</a></div>
    <div class="border">
        <div class="am-btn-group">
            <a id="setData" class="am-btn am-btn-secondary am-radius am-text-sm"><span class="am-icon-plus am-margin-right-sm"></span>更新数据</a>
        </div>
        <div class="am-form am-form-inline am-fr">
            <select name="pId" id="pId"><%=List_Pro_Str %></select>
            <select name="UserId" id="UserId"><%=List_User_Str %></select>
            <div class="am-form-group am-form-icon">
                <i class="am-icon-search"></i>
                <input name="txtKeywords" type="text" id="txtKeywords" value="<%=keywords %>" class="am-form-field am-input-sm" placeholder="请输入关键字" />
                <a id="lbtnSearch" class="am-btn am-btn-warning am-radius am-text-sm">搜索</a>
            </div>
        </div>
        <div class="am-cf"></div>
        <div class="imagelist2">
            <ul id="list">
                <%foreach (System.Data.DataRow m in rptList.Rows)
                  {%>
                <li>
                    <div class="preview listfile" data-url="<%=Path_File + m["PicPath"] + "/" + m["PicName"] %>">
                        <img src="<%=Path_File + m["PicPath"] + "/" + m["PicName"] %>" title="<%="项目:"+m["HosName"]+"&#10名称:"+m["PicName"]+"&#10用户名:"+m["UserName"]+"("+m["RealName"] +")"+ "&#10时间:"+  m["AddTime"].ToString() %>" />
                    </div>
                    <p class="file-title"><%=m["PicName"] %></p>
                </li>
                <%} %>
            </ul>
        </div>
        <div class="border-top am-padding">
            <div class="am-u-sm-10 pagelist">
                <ul>
                    <div class="am-fl"><%=PageContent %></div>
                </ul>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <script>
        $(function () {
            $(".listfile").click(function (i) {
                var url = $(this).attr("data-url");
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    shadeClose: true,
                    content: ' <img src="' + url + '" style="max-width:360px;" class="fq-copy">'
                });
            });
            $('#lbtnSearch').on('click', function () {
                var _pathname = window.location.pathname;
                var _pId = $('#pId').val(), _txtKeywords = $('#txtKeywords').val(), _UserId = $('#UserId').val();
                var _url = [];
                if (_pId != '') _url.push('pId=' + _pId);
                if (_txtKeywords != '') _url.push('keywords=' + encodeURIComponent(_txtKeywords));
                if (_UserId != '') _url.push('UserId=' + _UserId);
                if (_url.length > 0) {
                    window.location.href = '?' + _url.join('&');
                } else {
                    window.location.href = _pathname;
                }
            })
            $('#setData').on('click', function () {
                $.ajax({
                    url: 'LogCard.aspx',
                    type: "POST",
                    data: {},
                    dataType: "json",
                    success: function (data) {
                        if (data.state == "success") {
                            layer.msg(data.msg, { icon: 1, time: 1500, shade: 0.1, });
                        } else {
                            layer.msg(data.msg, { icon: 2, time: 1500, shade: 0.1, });
                        }
                    },
                    error: function (ajaxobj) {
                        if (ajaxobj.responseText != '')
                            alert(ajaxobj.responseText);
                    }
                });
            })
        })
    </script>
</body>
</html>
